'use strict'

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    const { INTEGER, DATE } = Sequelize
    // 创建表
    await queryInterface.createTable('visit', {
      id: {
        type: INTEGER(20).UNSIGNED,
        primaryKey: true,
        autoIncrement: true
      },
      count: {
        type: INTEGER,
        comment: '访问量'
      },
      created_time: DATE
    })
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('visit')
  }
}
